<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('集团信息列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <input type="text" name="searchParam" placeholder="编号/资产编码/名称/型号"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-info" onclick="$.table.importExcel()" shiro:hasPermission="clique:cliqueDetail:import">
                    <i class="fa fa-upload"></i> 导入
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('clique:cliqueDetail:edit')}]];
        var removeFlag = [[${@permission.hasPermi('clique:cliqueDetail:remove')}]];
        var prefix = ctx + "clique/cliqueDetail";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                importTemplateUrl: prefix + "/importTemplate",
                importUrl: prefix + "/importData",
                modalName: "集团信息",
                sortName: "createTime",
                sortOrder: "desc",
                height:520,
                columns: [
                    {
                        field : 'assetNo',
                        title : '卡片编号',
                        sortable:true
                    },
                {
                    field : 'assetName', 
                    title : '资产名称'
                },
                {
                    field : 'assetCode', 
                    title : '资产编码'
                },
                {
                    title : '资产类别',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push($.table.selectDictLabel([[${@dict.getType('asset_type')}]], row.assetType));
                        return actions.join('');
                    }
                },
                {
                    field : 'specifications', 
                    title : '规格'
                },
                {
                    field : 'assetModel', 
                    title : '型号'
                },
                    {
                        field : 'amount',
                        title : '数量'
                    },
                {
                    field : 'originalValue', 
                    title : '本币原值'
                },
                {
                    field : 'accumulatedDiscount', 
                    title : '累积折扣'
                },
                {
                    field : 'thisDiscount', 
                    title : '本年折扣'
                },
                {
                    field : 'netWorth', 
                    title : '净值'
                },
                {
                    field : 'netAmount', 
                    title : '净额'
                },
                {
                    field : 'impairment', 
                    title : '减值准备'
                },
                {
                    field : 'remark', 
                    title : '备注'
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
<!-- 导入区域 -->
<script id="importTpl" type="text/template">
    <form enctype="multipart/form-data" class="mt20 mb10">
        <div class="col-xs-offset-1">
            <input type="file" id="file" name="file"/>
            <div class="mt10 pt5">
                <a onclick="$.table.importTemplate()" class="btn btn-default btn-xs"><i class="fa fa-file-excel-o"></i> 下载模板</a>
            </div>
            <font color="red" class="pull-left mt10">
                提示：仅允许导入“xls”或“xlsx”格式文件！
            </font>
        </div>
    </form>
</script>
</html>